// Programming_Scala/src/ch09/pattern-match-actor-script.scala
import scala.actors.Actor
import scala.actors.Actor._

val fussyActor = actor {
  loop {
    receive {
      case s: String => println( "I got a String:  " + s )
      case i: Int => println( "I got an Int:  " + i ); sender ! "Int it is"
      case _ => println( "I have no idea what I just got." )
    }
  }
}

fussyActor ! "hi there"
fussyActor ! 23
fussyActor ! 3.33
fussyActor.!( "full on method call" )

